from torch import cuda as torch_cuda

class BasicConfig:
    def __init__(self, cuda=True, data_path=None, log_path=None, save_path=None, dataset="FB15k", model="TransE"):
        if not cuda:
            self.cuda = False
        else:
            assert torch_cuda.is_available(), "You must install cuda if you want to use GPU"
            self.cuda = True
        self.dataset = dataset
        self.do_test = False
        self.data_path = data_path

        self.model = model
        self.double_entity_embedding = False
        self.double_relation_embedding = False
        self.use_delta = False
        self.init_delta = 0.5

        self.negative_sample_size = 64
        self.hidden_dim = 128
        self.gamma = 24.0
        self.negative_adversarial_sampling = True
        self.adversarial_temperature = 1.0
        self.batch_size = 128
        self.test_batch_size = 4
        self.uni_weight = False

        self.learning_rate = 0.001
        self.min_learning_rate = 0.000001
        self.cpu_num = 10
        self.log_path = log_path
        self.save_path = save_path
        self.max_steps = 10000
        self.warm_up_steps = 1000
        self.epoch_num = 5

        self.log_steps = 100
        self.test_log_steps = 1000
        self.continue_train = False

        self.regularization = 0.0